<?php defined('INDEX_FILE') or die('forbidden');


/**
* MLT Web Engine
* http://www.molotsoft.ru
*
* @package MLT_WE
* @subpackage Prepare_Env
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: prepare_env.inc.php 9 2009-03-06 11:38:03Z molotsoft@gmail.com $
* @link $HeadURL: http://prepare-env.googlecode.com/svn/trunk/prepare_env.inc.php $
*/


define('PENV_PACKAGE', 'Prepare_Env');
define('PENV_VERSION', '1.0.0');

define('PENV_PHP_VERSION', '4.0.7');
version_compare(PHP_VERSION, PENV_PHP_VERSION, '>=') or trigger_error('required PHP_VERSION >= ' . PENV_PHP_VERSION, E_USER_NOTICE);


// php_flag display_errors on
if (!(bool)ini_get('display_errors')) {
	ini_set('display_errors', 1);
}

// php_value error_reporting E_ALL
if ((int)ini_get('error_reporting') !== E_ALL) {
	ini_set('error_reporting', E_ALL);
}


if (!function_exists('stripslashes_deep')) {
	function stripslashes_deep($value) {
		return is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
	}
}

// php_flag magic_quotes_gpc off
if ((bool)get_magic_quotes_gpc()) {
	$_GET = stripslashes_deep($_GET);
	$_POST = stripslashes_deep($_POST);
	$_COOKIE = stripslashes_deep($_COOKIE);
	$_REQUEST = stripslashes_deep($_REQUEST);
}

// php_flag magic_quotes_runtime off
if ((bool)get_magic_quotes_runtime()) {
	set_magic_quotes_runtime(0);
}

// php_flag magic_quotes_runtime off
if ((bool)ini_get('magic_quotes_runtime')) {
	ini_set('magic_quotes_runtime', 0);
}

// php_flag magic_quotes_sybase off
if ((bool)ini_get('magic_quotes_sybase')) {
	ini_set('magic_quotes_sybase', 0);
}


// php_value arg_separator.output "&amp;"
if (ini_get('arg_separator.output') !== '&amp;') {
	ini_set('arg_separator.output', '&amp;');
}


// $_SERVER['HTTPS']
if (!isset($_SERVER['HTTPS'])) {
	$_SERVER['HTTPS'] = 'off';
}


?>